home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MacApp Documentation / MacApp AppleLink Messages / MacApp.Tech$ 5⁄11⁄90 / 1256-Re AddResource Probl-May90 < prev    next >
Encoding:
Text File  |  1990-05-11  |  1.4 KB  |  33 lines  |  [TEXT/GEOL]

  1. Item    2874592                         7-May-90        15:45PDT
  2.  
  3. From:   LMILLETT                        Millett, Lonnie
  4.  
  5. To:     N0917                           E I DuPont, Simon Edkins,ASC,NAT
  6.  
  7. cc:     MACAPP.TECH$                    MacApp Technical
  8.  
  9. Sub:    Re: AddResource Problem
  10.  
  11. When MacApp saves a document with the DoWrite method, it actually is saving via
  12. a temporary copy of the file rather than saving it in place.  This is to
  13. protect you from losing your original document should some error occur in
  14. writing.  When you called AddResource in your DoWrite method what you ended up
  15. with was a new document with a single resource in it.  Since the write was
  16. successful, the old document was deleted, along with all of your resources and
  17. data, and the new document with the single resource became the current
  18. document.  You can indicate to MacApp that you would like to save a document in
  19. place with the fSaveInPlace field of TDocument.  However this will only be used
  20. if MacApp determines that there isn't enough space to save your document via a
  21. copy.
  22.  
  23. Unfortunately your first guess at the solution is the correct one.  You will
  24. need to write out your data fork and copy all existing resources for them to
  25. appear in your new document.  If that isn't possible, you can do a save in
  26. place, but you will need to override the behavior of a number of methods, in
  27. particular Save, SaveInPlace, and MakeNewCopy.
  28.  
  29. Lonnie Millett
  30. MacApp engineering
  31. Apple Computer Inc.
  32.  
  33.